import http from './index'
export default {
    // 请求示例
    /* getBanner() {
      return new Promise((resolve, reject) => {
        http('get', '/banner').then(
          (res) => {
            resolve(res)
          },
          (error) => {
            reject(error)
          }
        )
      })
    }, */

    // 获取所有公告
    getNotice() {
        return new Promise((resolve, reject) => {
            http('get', '/gg_notice').then(
                (res) => {
                    resolve(res)
                },
                (error) => {
                    reject(error)
                }
            )
        })
    },
    // 添加公告 data: {content,title,username}
    addNotice(data) {
        return new Promise((resolve, reject) => {
            http('post', '/gg_notice', data).then(
                (res) => {
                    resolve(res)
                },
                (error) => {
                    reject(error)
                }
            )
        })
    },
}
